package com.kawaiior.asoulworld.item.armor.asoulTeam;

import com.kawaiior.asoulworld.item.ModItems;
import com.kawaiior.asoulworld.item.armor.ItemArmorBase;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.EntityEquipmentSlot;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.living.LivingHurtEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;

import java.util.Random;

public class ItemArmorCarol extends ItemArmorBase {
    public ItemArmorCarol(String name, ArmorMaterial materialIn, int renderIndexIn, EntityEquipmentSlot equipmentSlotIn) {
        super(name, materialIn, renderIndexIn, equipmentSlotIn);
//        MinecraftForge.EVENT_BUS.register(this);
    }

//    @SubscribeEvent
//    public void playerWearCarolArmor(LivingHurtEvent event)
//    {
//        if (event.getEntity().world.isRemote){return;}
//        if (!(event.getSource().getTrueSource() instanceof EntityPlayer)){return;}
//        EntityLivingBase hurtOne = event.getEntityLiving();
//        EntityLivingBase attaker = (EntityLivingBase)event.getSource().getTrueSource();
//        if (   attaker.getItemStackFromSlot(EntityEquipmentSlot.HEAD).getItem()==ModItems.CAROL_HELMET &&
//               attaker.getItemStackFromSlot(EntityEquipmentSlot.CHEST).getItem()==ModItems.CAROL_CHESTPLATE &&
//               attaker.getItemStackFromSlot(EntityEquipmentSlot.LEGS).getItem()==ModItems.CAROL_LEGGINGS &&
//               attaker.getItemStackFromSlot(EntityEquipmentSlot.FEET).getItem()==ModItems.CAROL_BOOTS)
//        {
//            float h = attaker.getHealth();
//            float f1 = (21f-h)*(21f-h)*(21f-h)/16800f;
//            float f2 = event.getAmount() * (f1 +1);
//            event.setAmount(f2);
////            event.setAmount(event.getAmount() * (f +1f));
//        }
//    }

}
